package com.common.retrofit.methods;

import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.HaiNingService;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class SetFindPswMethods extends BaseMethods {

    private static SetFindPswMethods m_ins = null;

    public static SetFindPswMethods getInstance() {
        if (m_ins == null) {
            synchronized (SetFindPswMethods.class) {
                if (m_ins == null) {
                    m_ins = new SetFindPswMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Api/User/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }



    public void     setPsw(Subscriber<Object> subscriber,
                           String mobile,
                           String sms_code ,String newpwd ,String repeatpwd ) {
        Observable observable = initService().setPsw(System.currentTimeMillis()+"",
                SortUtils.getMyHash("mobile","newpwd","sms_code","repeatpwd"), Constans.ANDROID_APP_ID,"3",mobile,sms_code,newpwd,repeatpwd);
        toSubscribe(observable, subscriber);
    }
}
